package com.xiaoran.user20012.controller;


import com.xiaoran.user20012.entity.XrStore;
import com.xiaoran.user20012.service.IXrStoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author xiaoRan
 * @since 2022-03-10
 */
@RestController
@RequestMapping("/xr-store")
public class XrStoreController {
    @Autowired
    IXrStoreService xrStoreService;

    @PostMapping("/addOne")
    public boolean addOne(XrStore xrStore) {
        return xrStoreService.addOne(xrStore) == 1;
    }

    @GetMapping("/allStore")
    public List<XrStore> getAll() {
        return xrStoreService.getAll();
    }
}
